package com.ruoyi.project.surveys.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.surveys.mapper.SurveysInfoTypeMapper;
import com.ruoyi.project.surveys.domain.SurveysInfoType;
import com.ruoyi.project.surveys.service.ISurveysInfoTypeService;

/**
 * 问卷类型Service业务层处理
 * 
 * @author zhimin-hu
 * @date 2020-05-02
 */
@Service
public class SurveysInfoTypeServiceImpl implements ISurveysInfoTypeService 
{
    @Autowired
    private SurveysInfoTypeMapper surveysInfoTypeMapper;

    /**
     * 查询问卷类型
     * 
     * @param infoTypeId 问卷类型ID
     * @return 问卷类型
     */
    @Override
    public SurveysInfoType selectSurveysInfoTypeById(Long infoTypeId)
    {
        return surveysInfoTypeMapper.selectSurveysInfoTypeById(infoTypeId);
    }

    /**
     * 查询问卷类型列表
     * 
     * @param surveysInfoType 问卷类型
     * @return 问卷类型
     */
    @Override
    public List<SurveysInfoType> selectSurveysInfoTypeList(SurveysInfoType surveysInfoType)
    {
        return surveysInfoTypeMapper.selectSurveysInfoTypeList(surveysInfoType);
    }

    /**
     * 新增问卷类型
     * 
     * @param surveysInfoType 问卷类型
     * @return 结果
     */
    @Override
    public int insertSurveysInfoType(SurveysInfoType surveysInfoType)
    {
        surveysInfoType.setCreateTime(DateUtils.getNowDate());
        return surveysInfoTypeMapper.insertSurveysInfoType(surveysInfoType);
    }

    /**
     * 修改问卷类型
     * 
     * @param surveysInfoType 问卷类型
     * @return 结果
     */
    @Override
    public int updateSurveysInfoType(SurveysInfoType surveysInfoType)
    {
        surveysInfoType.setUpdateTime(DateUtils.getNowDate());
        return surveysInfoTypeMapper.updateSurveysInfoType(surveysInfoType);
    }

    /**
     * 批量删除问卷类型
     * 
     * @param infoTypeIds 需要删除的问卷类型ID
     * @return 结果
     */
    @Override
    public int deleteSurveysInfoTypeByIds(Long[] infoTypeIds)
    {
        return surveysInfoTypeMapper.deleteSurveysInfoTypeByIds(infoTypeIds);
    }

    /**
     * 删除问卷类型信息
     * 
     * @param infoTypeId 问卷类型ID
     * @return 结果
     */
    @Override
    public int deleteSurveysInfoTypeById(Long infoTypeId)
    {
        return surveysInfoTypeMapper.deleteSurveysInfoTypeById(infoTypeId);
    }
}
